<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>流量防护-测试页面</title>
    <link rel="icon" href="https://img.alicdn.com/tfs/TB1_ZXuNcfpK1RjSZFOXXa6nFXa-32-32.ico" type="image/x-icon">
    <link href="https://g.alicdn.com/code/lib/bootstrap/4.5.3/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://g.alicdn.com/code/lib/jquery/1.11.1/jquery.min.js"></script>
    <script src="./js/index.js"></script>
    <script src="./js/smoothscroll.js"></script>
    <script src="./js/visible.min.js"></script>
    <script src="./js/pro-bars.js"></script>
    <script type="text/javascript" src="./js/jquery-ui.min.js"></script>
    <link href="./css/index.css" rel="stylesheet"/>
    <link href="./css/pro-bars.min.css" rel="stylesheet"/>
</head>

<body>
<div class="container">
    <h5>流量防护测试</h5>
    <button class="btn btn-primary" id="normalRequest">普通请求</button>
    <button class="btn btn-primary" id="rateLimiting">接口流控</button>
    <button class="btn btn-primary" id="concurrencyIsolation">并发隔离</button>
    <button class="btn btn-primary" id="hotspotProtection">热点参数</button>
    <button class="btn btn-primary" id="circuitBreaker">服务熔断</button>
    <div id="console"></div>
</div>

<script>
    document.addEventListener('DOMContentLoaded', () => {
    const buttons = ['normalRequest', 'rateLimiting', 'concurrencyIsolation', 'hotspotProtection', 'circuitBreaker'];
    buttons.forEach(id => {
        document.getElementById(id).addEventListener('click', () => {
            this.blur();
            const funcName = `test${id.charAt(0).toUpperCase() + id.slice(1)}`;
            window[funcName]();
        });
    });
});

</script>
</body>

</html>